<?php

namespace app\api\controller\agent;


use app\admin\model\Shopcharge;
use app\admin\model\Shoporder;
use app\admin\model\Shopwifi;
use app\common\controller\Api;

/**
 *
 */
class Shop extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];

    /**
     * 店铺列表接口
     *
     */
    public function getList()
    {
        $user = $this->auth->getUser();

        $keyword = $this->request->param('keyword');
        $where = array();
        $where['agent_id'] = $user['id'];
        if ($keyword != '') {
            $where['name'] = array('like', "'%" . $keyword . "%'");
        }
        $shopModel = new \app\admin\model\Shop();
        $list = $shopModel->where($where)->select();
        foreach ($list as $key => $val) {
            $list[$key]['logo'] = cdnurl($val['logo'], true);
        }
        $this->success('请求成功', $list);
    }







}
